package com.jt;

import com.jt.provider.interceptor.Interceptor;
import com.jt.provider.interceptor.Interceptor01;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Scanner;

@Configuration
public class SpringWebConfig implements WebMvcConfigurer {
    /**
     * registry负责进行拦截器注册对象，会将拦截器放到容器中，一般List集合*/
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new Interceptor())
                //拦截路径
                .addPathPatterns("/provider/*")
                //排除哪些
                .excludePathPatterns("/provider/sentinel03");


            registry.addInterceptor(new Interceptor01())
                    .addPathPatterns("/provider/*")
                    .excludePathPatterns("/provider/sentinel03");

    }
}
